﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace aQuery
{
    public class ActionRepeater<T> : ActionReaderChild<T>, IExecutable where T : class
    {

        #region public members
        public int Times { get; set; }

        public void ExecuteYourself()
        {
            int count = Times;
            while (count > 0)
            {
                ActionReader.Execute();
                count--;
            }
        }
        #endregion

        #region internal members
        internal ActionRepeater(ActionReader<T> target, int times) : base(target)
        {
            this.Times = times;
        }
        #endregion

    }
}
